import 'dart:io';

import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:x3_base_package/x3_base_package.dart';

class BusinessHtmlWebViewPage extends StatefulWidget {

  static final String sName = 'BusinessHtmlWebViewPage';

  @override
  _BusinessHtmlWebViewPageState createState() => _BusinessHtmlWebViewPageState();

}

class _BusinessHtmlWebViewPageState extends State<BusinessHtmlWebViewPage> {

  @override
  void initState() {
    if ( Platform.isAndroid ) WebView.platform = SurfaceAndroidWebView();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    dynamic arguments = BaseRouterUtil.getArguments(context);
    String webUrl = BaseUtils.getKeyData(arguments, 'webUrl').toString();
    return BaseScaffoldComponent(
      title: '网页详情',
      child: WebView( initialUrl: webUrl ),
    );
  }

}
